import { createBrowserRouter } from "react-router-dom";
// import AppLayout from "../layouts/AppLayout";
import HomePage from "@/pages/Home";
import AboutPage from "@/pages/About";
import About from "@/pages/About/components/About";
import ApiTest from "@/pages/ApiTest";
import Zustand from "@/pages/Zustand";
import ScrollEle from "@/pages/Scroll";
import NewDataTable from "../pages/NewsData";
import FormPage from "../pages/Form/FormPage";
import WaterMark from "../pages/WaterMark";
import EchartsDemo from "../pages/Echarts";
import {
  DesktopOutlined,
  FileOutlined,
  PieChartOutlined,
  TeamOutlined,
  UserOutlined,
} from "@ant-design/icons";
import Admin from "../componnets/Admin";
import NotFound from "../pages/NotFound";
import Login from "@/pages/Login";

// 定义路由配置
const routes = [
  {
    path: "/login",
    element: (
      <div>
        <Login />
      </div>
    ),
  },
  {
    path: "/",
    element: <Admin />,
    children: [
      {
        index: true,
        element: <HomePage />,
        breadcrumbName: "Home",
        icon: <PieChartOutlined />,
      },
      {
        path: "about",
        element: <AboutPage />,
        breadcrumbName: "About/关于我们",
        icon: <UserOutlined />,
        children: [
          {
            path: "about1",
            element: <About />,
            breadcrumbName: "About1",
            icon: <UserOutlined />,
          },
        ],
      },
      {
        path: "apitest",
        element: <ApiTest />,
        breadcrumbName: "Api Test",
        icon: <DesktopOutlined />,
      },
      {
        path: "zustand",
        element: <Zustand />,
        breadcrumbName: "Zustand",
        icon: <FileOutlined />,
      },
      {
        path: "scroll",
        element: <ScrollEle />,
        breadcrumbName: "ScrollEle",
        icon: <FileOutlined />,
      },
      {
        path: "newdata",
        element: <NewDataTable />,
        breadcrumbName: "New Data",
        icon: <TeamOutlined />,
      },
      {
        path: "form",
        element: <FormPage />,
        breadcrumbName: "for,",
        icon: <TeamOutlined />,
      },
      {
        path: "watermark",
        element: <WaterMark />,
        breadcrumbName: "Watermark",
        icon: <TeamOutlined />,
      },
      {
        path: "echarts",
        element: <EchartsDemo />,
        breadcrumbName: "echarts",
        icon: <TeamOutlined />,
      },
    ],
  },
  {
    path: "*",
    element: (
      <div>
        <NotFound />
      </div>
    ),
  },
];

// 创建路由
const router = createBrowserRouter(routes);

export default router;
